#!/bin/bash
if [ $1 -eq 1 ] ; then
    echo "insmod"
    modprobe libcrc32c
    insmod btrfs.ko
    echo "losetup"
    losetup /dev/loop0 /root/storage/btrfs/btrfs.img
    echo "mount with acl"
    mount -t btrfs /dev/loop0 /mnt/btrfs

elif [ $1 -eq 2 ] ; then
    echo "umount"
    umount /mnt/btrfs
    echo "rmmod"
    rmmod btrfs.ko
elif [ $1 -eq 3 ] ; then
    echo "insmod"
    modprobe libcrc32c
    insmod btrfs.ko
    echo "losetup"
    losetup /dev/loop0 /root/storage/btrfs/btrfs.img
    echo "mount without acl"
    mount -t btrfs -o noacl /dev/loop0 /mnt/btrfs
fi
